# Contributor: omni <omni+alpine@hack.org>
# Maintainer: omni <omni+alpine@hack.org>
pkgname=py3-urwid_readline
_pkgname=urwid_readline
pkgver=0.14
pkgrel=1
pkgdesc="text input widget for urwid that supports readline shortcuts"
url="https://github.com/rr-/urwid_readline"
arch="noarch"
license="MIT"
depends="python3 py3-urwid"
makedepends="py3-gpep517 py3-setuptools py3-wheel"
checkdepends="py3-pytest py3-pytest-runner"
#options="!check" # no test suite
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/rr-/urwid_readline/archive/$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

build() {
	gpep517 build-wheel --wheel-dir .dist --output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	python3 -m installer -d "$pkgdir" .dist/*.whl
}

sha512sums="
cc24cc72110f6cecbd71f6bda355adc74acf9697dd0636c35a679767e1406a4a15ef53fb03e2e69d20a523f09020fe17b9cf6ac41f1516af52ed9b9736c77d14  py3-urwid_readline-0.14.tar.gz
"
